package File;

import java.io.File;
import java.io.IOException;

public class Demo5 {
    public static void main(String[] args) throws IOException {
        File file = new File("test.txt");
        System.out.println(file.createNewFile());//若文件不存在则创建文件，返回true，若存在，返回false
    }
}
